package net.lagou.mathsort;

import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.NullWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Mapper;

import java.io.IOException;

/**
 * @author zhangwei
 * @date 2020/8/11  23:34
 * @jdkversion 1.8
 * @description xxxx
 */
public class NumberMapper extends Mapper<LongWritable, Text,LongWritable, NullWritable>{
    LongWritable longWritable = new LongWritable();
    @Override
    protected void map(LongWritable key, Text value, Context context) throws IOException, InterruptedException {
        final Long aLong = Long.valueOf(value.toString());
        longWritable.set(aLong);
        context.write(longWritable,NullWritable.get());
    }
}
